import time

from selenium import webdriver
from selenium.webdriver.common.by import By

path='msedgedriver.exe'
browser=webdriver.Edge(path)
url='https://www.bilibili.com'
browser.get(url)
content=browser.page_source
button=browser.find_element(By.CLASS_NAME,'nav-search-input')
button.send_keys('萌娘百科')
button.click()
button=browser.find_element(By.CLASS_NAME,'nav-search-btn')
button.click()
# TODO 模拟往下滚动
for i in range(5):
    browser.execute_script("window.scrollBy(0, 500);")  # 向下滚动500像素
    time.sleep(1)  # 等一小下下，像是人在慢慢翻页